package com.item.yxlottery.yxlottery.views;

/*
 *------------------------------
 * @创建者      Administrator
 * @创建时间    2016/12/19 15:37
 * @文件描述    加载显示对话框
 *------------------------------
 */

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.flyco.dialog.widget.NormalDialog;
import com.github.ybq.android.spinkit.SpinKitView;
import com.github.ybq.android.spinkit.SpriteFactory;
import com.github.ybq.android.spinkit.Style;
import com.item.yxlottery.yxlottery.R;

public class StringLoadingDialog extends NormalDialog {

    private final View mView;
    private final TextView mTvText;

    public StringLoadingDialog(Context context) {
        super(context);
        mView = View.inflate(mContext, R.layout.layout_stringloadingdialog, null);
        SpinKitView spinKitView = (SpinKitView) mView.findViewById(R.id.skv_loading_bar);
        mTvText = (TextView) mView.findViewById(R.id.tv_loading_text);
        spinKitView.setColor(0xffff0000);
        spinKitView.setIndeterminateDrawable(SpriteFactory.create(Style.FADING_CIRCLE));
    }

    /*- 设置加载显示的文字 -*/
    public void setLoadText(String text) {
        mTvText.setText(text);
    }

    @Override
    public View onCreateView() {
        widthScale(.35f);
        return mView;
    }

    @Override
    public void setUiBeforShow() {

    }


}
